<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>    
<%@ include file="/taglibs.jsp"%>
<script type="text/javascript" charset="UTF-8" src="/js/jquery-ui-1.7.2.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/jquery-ui-1.7.2.custom.css"/>


<script type="text/javascript">
$().ready(function(){	
	$("#checkForm").click(function(){
		var empty=0;
		$('input:text').each(function(){
			$(this).attr("style","");
			if($.trim($(this).val())==""){
				$(this).css("border","2px solid red");
				empty++;
				
			}
		});
		if(empty>0){
			alert("红框标示处不可为空");
		}else{
	
			$.post("makeXML.do",{loc:$("#loc").val(),mainWebsite:$("#mainWebsite").val()},
				function (xmlResult){		 
					if(xmlResult == "done"){
				  		alert("XML已经产生");
				  		top.location.href = "hao123Main.do";										
					}else{
						alert("XML产生失败");					
					}
				},"json");
		}
	});

});
		
</script>

<h1>Hao123活动设置</h1>
<div class="f-link">
<a href="addHao123.do">新增活动</a>
<a href="/3party_ex/hao123.xml" target="_blank">检视XML内容</a>
</div>
<br><br><br><br>
<div width="100%" align="right">共${fn:length(hao123s)}笔资料</div>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="0" class="tb-data">
<tr>
  <td class="bg-yl">*站点链接&lt;loc&gt;(长度100)</td>
  <td><input type="text" name="loc" id="loc" maxlength="100" value="${loc }" size="90%"></td>
 </tr>
<tr>
  <td class="bg-yl">*站点名称&lt;website&gt;(长度25个中文字)</td>
   <td><input type="text" id="mainWebsite" maxlength="25" value="耀点100百货商城" size="90%" readonly></td>
 </tr>
</table>
<div class="f-link">
XML最后产生日:${xmlLastModify }
	<a href="#" id="checkForm">储存并产出XML檔案</a>
</div>
<br><br><br><br>
<table width="100%" border="1" cellspacing="0" cellpadding="0" class="tb-data">
<tr>
  <th>主打活动</th>
  <th>活动内容</th>
  <th>活动分类</th>
  <th>活动开始时间</th>
  <th>活动结束时间</th>
  <th>操作</th>  
</tr>
<c-rt:forEach items="${hao123s}" var="hao123">
<tr>
  <td>${hao123.major=='1'?'是':'否' }</td>
  <td>${hao123.title }</td>
  <td>${categoryMenu.options[hao123.category].name}</td>
  <td><fmt:formatDate value="${hao123.startTime}" pattern="yyyy-MM-dd HH:mm" /></td>
  <td><fmt:formatDate value="${hao123.endTime}" pattern="yyyy-MM-dd HH:mm" /></td>
  <td><a href="editHao123Detail.do?detailId=${hao123.mktXMLId }">编辑</a>/<a href ="deleteHao123Detail.do?detailId=${hao123.mktXMLId }">删除</a></td>  
</tr>
</c-rt:forEach>
</table>
* 请确认以上内容只限定一个主打活动
<div class="f-link">
	共${fn:length(hao123s)}笔资料
</div>